;; examples from https://www.cs.indiana.edu/scheme-repository/R4RS/r4rs_12.html

(define t1
  (local-syntax when (lambda (exp env)
		       (let ((test (syn-car (syn-cdr exp)))
			     (body (syn-car (syn-cdr (syn-cdr exp)))))
			 (list (syntax-quote if) test body (syntax-quote #f))))
		(let ((if (box #t)))
		  (when if (set-box-value! if 'now))
		  (print (box-value if)))))                    ;=>  now

(define t2
  (let ((x 'outer))
    (local-syntax m (lambda (exp env) (syntax-quote x))
		  (let ((x 'inner))
		    (print (m))))))                ;=>  outer
